#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QButtonGroup>
#include<QLabel>
#include"filewindow.h"
#include"friendwindow.h"
#include"minewindow.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);
    virtual void mouseMoveEvent(QMouseEvent *event);
    static MainWindow &getInstance();
    FriendWindow *getPFriend() const;
    void setUserLabel(const char* name); // 设置登录用户信息的Label值
    FileWindow *getFileWindow() const;

private slots:
    void on_btnmin_clicked();

    void on_btnmax_clicked();

    void on_btnclose_clicked();

private:
    Ui::MainWindow *ui;

    QButtonGroup btnGroup;
    FileWindow *m_pFile;
    FriendWindow *m_pFriend;
    MineWindow *m_pMine;

    bool m_isPressed =false;
    QRect m_titlerect;
    QPoint m_wnd;
    QPoint press;
    bool isMaximized;


};
#endif // MAINWINDOW_H
